home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
indents.zip
/
globals.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-30
|
17KB
|
323 lines
/**
* Copyright 1989 Object Design, Inc.
* Copyright (c) 1985 Sun Microsystems, Inc.
* Copyright (c) 1980 The Regents of the University of California.
* Copyright (c) 1976 Board of Trustees of the University of Illinois. All
* rights reserved.
*
* Redistribution and use in source and binary forms are permitted provided
* that the above copyright notice and this paragraph are duplicated in all
* such forms and that any documentation, advertising materials, and other
* materials related to such distribution and use acknowledge that the
* software was developed by the University of California, Berkeley, the
* University of Illinois, Urbana, and Sun Microsystems, Inc. The name of
* either University or Sun Microsystems may not be used to endorse or
* promote products derived from this software without specific prior written
* permission. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
* OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#)globals.h 6.0 (Berkeley) 92/06/15 */
/* Note: To use this file you must set the linker to generate ComDedf's
* (common definitions). */
#include <stdio.h>
#include <memory.h>
#ifdef __OS2__
# define INCL_NOPM
# define INCL_NOPMAPI
# define INCL_BASE
# define INCL_DOSFILEMGR
# include <os2.h>
#endif /* __OS2__ */
/* Any compiler which supports real prototypes etc., */
#if (defined __MSDOS__) || (defined MSDOS) || (defined __STDC__) || (defined __OS2__)
# ifndef ANSIC
# define ANSIC
# endif /* ANSIC */
#endif /* __MSDOS__ || MSDOS) || __STDC__ || __OS2__ */
#define BACKSLASH '\\'
#define bufsize 1000 /* size of internal buffers */
#define inp_bufs 1000 /* size of input buffer */
#define sc_size 5000 /* size of save_com buffer */
#define label_offset 2 /* number of levels a label is placed to left
* of code */
#define cplus_ppp_indent 2 /* spaces to indent public, private,
* protected in c++ */
#define false 0
#define true 1
#ifdef ANSIC
# include <malloc.h>
# define check_size(name) \
if (e_##name >= l_##name) { \
register int nsize = l_##name-s_##name+400; \
name##buf = (char *) realloc(name##buf, nsize); \
e_##name = name##buf + (e_##name-s_##name) + 1; \
l_##name = name##buf + nsize - 5; \
s_##name = name##buf + 1; \
}
#else /* ANSIC */
# define check_size(name) \
if (e_/**/name >= l_/**/name) { \
register int nsize = l_/**/name-s_/**/name+400; \
name/**/buf = (char *) realloc(name/**/buf, nsize); \
e_/**/name = name/**/buf + (e_/**/name-s_/**/name) + 1; \
l_/**/name = name/**/buf + nsize - 5; \
s_/**/name = name/**/buf + 1; \
}
#endif /* ANSIC */
FILE *input; /* the file id for the input file */
FILE *output; /* the output file */
char *s_lab; /* start ... */
char *e_lab; /* .. and end of stored label */
char *l_lab; /* limit of label buffer */
char *s_code; /* start ... */
char *e_code; /* .. and end of stored code */
char *l_code; /* limit of code section */
char *s_com; /* start ... */
char *e_com; /* ... and end of stored comments */
char *l_com; /* limit of comment buffer */
char in_buffer[inp_bufs]; /* input buffer */
char *buf_ptr; /* ptr to next character to be taken from
* in_buffer */
char *buf_end; /* ptr to first after last char in in_buffer */
char *bp_save; /* saved value of buf_ptr when taking input
* from save_com */
char *be_save; /* similarly saved value of buf_end */
char token[bufsize]; /* the last token scanned */
int cplus; /* c++ */
int pointer_as_binop;
int blanklines_after_declarations;
int blanklines_before_blockcomments;
int blanklines_after_procs;
int blanklines_around_conditional_compilation;
int swallow_optional_blanklines;
int n_real_blanklines;
int prefix_blankline_requested;
int postfix_blankline_requested;
int tabsize;
int usetabs;
int list_defines; /* PETER */
int show_options; /* PETER */
int useStdio;
int useProfile;
int break_comma; /* when true and not in parens, break after a
* comma */
int btype_2; /* when true, brace should be on same line as
* if, while, etc. */
int btype_3; /* when true, braces are not only on the next
* line but indented with the enclosed code */
float case_ind; /* indentation level to be used for a "case
* n:" */
int code_lines; /* count of lines with code */
int had_eof; /* set to true when input is exhausted */
int line_no; /* the current line number. */
int max_col; /* the maximum allowable line length */
int verbose; /* when true, non-essential error messages
* are printed */
int cuddle_else; /* true if else should cuddle up to '}' */
int else_or_endif; /* -cp if in a #else */
int star_comment_cont; /* true iff comment continuation lines
* should have stars at the beginning of
* each line. */
int comment_delimiter_on_blankline;
int troff; /* true iff were generating troff input */
int procnames_start_line; /* if true, the names of procedures
* being defined get placed in column
* 1 (i.e. a newline is placed
* between the type of the procedure
* and its name) */
int proc_calls_space; /* If true, procedure calls look like:
* foo(bar) rather than foo (bar) */
int parens_space; /* If true, parens gets spaces inside them */
int format_col1_comments; /* If comments which start in column
* 1 are to be magically reformatted
* (just like comments that begin in
* later columns) */
int inhibit_formatting; /* true if INDENT OFF is in effect */
int suppress_blanklines; /* set iff following blank lines
* should be suppressed */
int continuation_indent; /* set to the indentation between the
* edge of code and continuation
* lines */
int lineup_to_parens; /* if true, continued code within parens
* will be lined up to the open paren */
int Bill_Shannon; /* true iff a blank should always be inserted
* after sizeof */
int blanklines_after_declarations_at_proctop; /* This is vaguely
* similar to
* blanklines_after_decla
* rations except that